import Vue from 'vue'
import Router from 'vue-router'
import Nav from '../components/Nav'
import AboutUs from '../components/AboutUs'
import Introduction from '../components/Introduction'
import NewsIndex from '../components/NewsIndex'
import NewsDetail from '../components/NewDetail'
import ProductDetail from '../components/ProductDetail'
import Science from '../components/Science'
import ScienceDetail from '../components/ScienceDetail'
import Scan from '../components/Scan'

// 用于嵌套的路由组件
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/index',
      name: 'Nav',
      component: Nav,
      meta:{
        title:"首页"
      }
    },
    {
      path: '/aboutUs',
      name: 'AboutUs',
      component: AboutUs,
      meta:{
        title:"关于我们"
      }
    },
    {
      path: '/introduction',
      name: 'Introduction',
      component: Introduction,
      meta:{
        title:"公司简介"
      }
    },
    {
      path: '/newsIndex',
      name: 'NewsIndex',
      component: NewsIndex,
      meta:{
        title:"新闻中心"
      }
    },
    {
      path: '/newsDetail/:id',
      name: 'NewDetail',
      component: NewsDetail, meta:{
        title:"新闻详情"
      }
    },
    {
      path: '/productDetail/:id',
      name: 'ProductDetail',
      component: ProductDetail,
      meta:{
        title:"产品详情"
      }
    },
    {
      path: '/science',
      name: 'Science',
      component: Science,
      meta:{
        title:"知识科普"
      }
    },
    {
      path: '/scienceDetail/:id',
      name: 'ScienceDetail',
      component: ScienceDetail,
      meta:{
        title:"知识科普详情"
      }
    },
    {
      path: '/scan',
      name: 'Scan',
      component: Scan,
      meta:{
        title:"产品溯源"
      }
    },
  ]
});
